{
  "properties" : { },
  "id" : "1a2ba625748d449d9777521997ba8c04",
  "script" : null,
  "groupId" : "0e4db7db28de4bbcad440c21a3c775e1",
  "name" : "认领",
  "createTime" : null,
  "updateTime" : 1741274131408,
  "lock" : null,
  "createBy" : null,
  "updateBy" : "可辉",
  "path" : "claim",
  "method" : "GET",
  "parameters" : [ {
    "name" : "taskId",
    "value" : "52a836ed-fa9d-11ef-8b05-f4b3016ece8b",
    "description" : null,
    "required" : true,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 200,\n    \"msg\": \"success\",\n    \"data\": \"ok\"\n}",
  "description" : "通过指定公共任务中的任务id，将其归纳到自己下面，避免同时多人处理",
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import 'org.activiti.engine.RepositoryService' as repositoryService;
import 'org.activiti.engine.RuntimeService' as runtimeService;
import 'org.activiti.engine.TaskService' as taskService;
import 'com.wiwf.model.security.service.SysTokenService' as sysTokenService;
import org.activiti.api.process.model.ProcessInstance;
import log;

var user = sysTokenService.getTokenUser(cookie[sysTokenService.getTokenKey()]);
var userId = user.userId+"";

    try {
        taskService.claim(taskId, userId);
    } catch(e) {
        exit 401, e.message
    }

return "ok";